<template>

  <div>

    <data-table
      ref="pagingTable"
      :options="options"
      :list-query="listQuery"
    >

      <template slot="filter-content">
        <dic-list-select v-model="listQuery.params.cusType" dic-code="cus_type" title="客户类型" />
        <dic-list-select v-model="listQuery.params.source" dic-code="source" title="客户来源" />
        <dic-list-select v-model="listQuery.params.level" dic-code="level" title="客户级别" />
        <el-input v-model="listQuery.params.name" style="width: 200px" placeholder="搜索客户名称" class="filter-item" />

      </template>

      <template slot="data-columns">


        <el-table-column
          label="客户名称"
          show-overflow-tooltip>

          <template slot-scope="scope">
            <router-link class="router-link" :to="{name: 'CustomerUpdate', params:{id: scope.row.customerId}}">
              {{scope.row.customerId_dictText}}
            </router-link>
          </template>

        </el-table-column>

        <el-table-column
          align="center"
          label="认领时间"
          prop="startTime"
        />

        <el-table-column
          align="center"
          label="释放时间"
          prop="endTime"
        />

        <el-table-column
          align="center"
          label="持有天数"
          prop="keepDay"
        />

        <el-table-column
          align="center"
          label="跟进结果"
          prop="result_dictText"
        />

        <el-table-column
          align="center"
          label="备注信息"
          prop="remark"
        />


      </template>
    </data-table>

  </div>

</template>

<script>
import DataTable from '@/components/DataTable'
import permission from '@/directive/permission'
import DicListSelect from '@/components/DicListSelect'
export default {
  directives: { permission },
  components: { DicListSelect, DataTable },
  props: {
    customerId: String
  },
  data() {
    return {
      listQuery: {
        current: 1,
        size: 10,
        params: {
          customerId: ''
        }
      },

      options: {

        add: {
          enable: false
        },
        edit: {
          enable: false
        },
        delete: {
          enable: false
        },

        // 列表请求URL
        listUrl: '/api/customer/track/paging-history'
      }
    }
  },

  watch: {
    customerId: {
      handler(val) {
        this.listQuery.params.customerId = val
      }
    }
  },

  created() {
    this.listQuery.params.customerId = this.customerId
  },

  methods: {

  }
}
</script>
